const Util = {
  //获取原型链
  prototype(node) {
    let prototypes = []
    if (!node.__proto__) return []
    prototypes.push(node.__proto__, ...this.prototype(node.__proto__))
    return prototypes
  },
  isInputForm(node) {
    return node instanceof HTMLInputElement
  },
  substr(start, num) {
    if (Util.isInputForm(this)) {
      return this.value.substr(start, num)
    } else {
      return this.textContent.substr(0, 2)
    }
  },
}

export default Util
